
// 关键词高亮效果
export default {
    bind(el,binding,vnode){
		const {value} = binding;
		if(value && typeof value==='object'){
			const {hWord,word} = value;
			el.innerHTML = word.replace(new RegExp(hWord,'ig'),(a)=>{
				return `<span style="color: #f87a23;">${a}</span>`
			})
		}
	},
	update(el,binding,vnode){
		const {value} = binding;
		if(value&&typeof value==='object'){
			const {hWord,word} = value;
			el.innerHTML = word.replace(new RegExp(hWord,'ig'),(a)=>{
				return `<span style="color: #f87a23;">${a}</span>`
			})
		}
	}
}